<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:a="http://richfaces.org/a4j"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:s="http://jboss.com/products/seam/taglib"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:rich="http://richfaces.org/rich"
	xmlns:rg="http://www.ruijie.com.cn/faces/ui"
	xmlns:c="http://java.sun.com/jstl/core"
	template="/layout/contentLayout.xhtml">

	<ui:param name="param_pageTitle"
		value="#{messages.luyuan_crm_menu_order}" />
	<ui:param name="param_navigationUrl"
		value="/luyuan/sale/layout/navigationSale.jsf" />

	<ui:define name="road">
		<span>销售记录</span>
	</ui:define>

	<!-- content -->
	<ui:define name="content">
		<rg:areaPanel>
			<h:form>
				<rg:areaPanel type="searchPanel"  style="margin: 10px 0;" >
					<rg:fieldSet column="auto">
						<rg:calendar value="#{orderFinanceAction.startDate}" label="开始日期"
							datePattern="yyyy-MM-dd" showApplyButton="false" />
						<rg:calendar value="#{orderFinanceAction.endDate}" label="结束日期"
							datePattern="yyyy-MM-dd" showApplyButton="false" />
						<h:commandButton styleClass="button"
							value="#{messages.luyuan_crm_query}" />
					</rg:fieldSet>
				</rg:areaPanel>

				<rg:titlePanel headerTitle="销售记录"
					style="margin-top: 10px;" readonly="false">
					
					<ui:define name="headerActions">
						<h:commandLink actionListener="#{orderFinanceAction.exportExcel()}" oncomplete=""
							value="导出查询结果" />
					</ui:define>
					
					<rg:table id="orderTable"
						value="#{orderFinanceAction.orderTableModel}" var="item">
						<rg:column property="id" title="订单号" />
						<rg:column property="createTime" title="购买时间" 
							datePattern="yyyy-MM-dd HH:mm" converter="#{dateConverter}" />
						<rg:column property="saleman.userName" title="销售员" />
						<rg:column property="saleman.partyGroup.partyGroupName"
							title="销售分组" />
						<rg:column property="customer.name" title="购买会员" />
						<rg:column property="oldAmount" title="原价" />
						<rg:column property="amount" title="成交额" />
					</rg:table>
				</rg:titlePanel>
			</h:form>
		</rg:areaPanel>
		<a:form>
			<a:jsFunction name="reRenderConfirmOrderTable"
				reRender="confirmOrderTable" />
		</a:form>
	</ui:define>
</ui:composition>